Skip to content

Fix BLAS compilation with AdaptiveCpp and export CMake options#7

Merged
Rbiessy merged 4 commits intouxlfoundation:mainfrom
rafbiels:adaptivecpp
Apr 3, 2025
Merged

Fix BLAS compilation with AdaptiveCpp and export CMake options#7
Rbiessy merged 4 commits intouxlfoundation:mainfrom
rafbiels:adaptivecpp

Conversation

@rafbiels
Copy link
Contributor

@rafbiels rafbiels commented Mar 24, 2025

  1. Remove unused function enqueue_deallocate in helper.h (left over from refactoring).
  2. Add missing BLAS_ENABLE_COMPLEX protection in Gemm::store_packet.
  3. Skip second template parameter in sycl::vec::load and sycl::vec::store calls in Gemm::store_packet when compiling with AdaptiveCpp, which doesn't support it.
  4. Improve detection of using AdaptiveCpp in CMake configuration to disable complex data support.
  5. Properly define and export cmake options BLAS_ENABLE_COMPLEX and BLAS_ENABLE_USM such that dependent projects can read and use them.
  6. Bump project version to 0.2.0, marking the CMake changes in the previous point.

1. Remove unused function enqueue_deallocate in helper.h (left over from refactoring).
2. Add missing BLAS_ENABLE_COMPLEX protection in Gemm::store_packet.
3. Skip second template parameter in vec::load and vec::store when compiling with AdaptiveCpp, which doesn't support it.
4. Improve detection of using AdaptiveCpp in CMake configuration to disable complex data support.
rafbiels added a commit to rafbiels/oneMath that referenced this pull request Mar 24, 2025
The generic BLAS backend currently offers limited support for
AdaptiveCpp, where:
* complex data type is not supported
* USM API is not supported

Add the required protections to make the generic BLAS backend
compile and run correctly in the capacity it offers with AdaptiveCpp.
That is, make the buffer USM without complex data work fine. Throw
the unimplemented exception for the unsupported features.

Note: fixes on the backend side are also required to actually compile,
see uxlfoundation/generic-sycl-components#7
@rafbiels rafbiels changed the title Fix BLAS compilation with AdaptiveCpp Fix BLAS compilation with AdaptiveCpp and export CMake options Mar 28, 2025
@rafbiels
Copy link
Contributor Author

@Rbiessy shall we bump the project version to mark the first version exporting the CMake variables? The dependent projects reading those variables could then require the new version.

Copy link
Contributor

@Rbiessy Rbiessy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Rbiessy shall we bump the project version to mark the first version exporting the CMake variables? The dependent projects reading those variables could then require the new version.

That's a good point yes it makes sense!

I didn't notice that PR before, the changes look good to me, thanks.

Version 0.2.0 now uses CMakePackageConfigHelpers, exports
the targets and variables into separate .cmake files
(onemath_sycl_blas-targets.cmake and onemath_sycl_blas-config.cmake)
and exports the variables BLAS_ENABLE_COMPLEX and BLAS_ENABLE_USM
correctly, such that they can be used by dependent projects.
The version file has to be named <config-file-name>-version, otherwise
find_package will not find it and set the version to "unknown". Since
the config file is named onemath_sycl_blas-config, name the version file
onemath_sycl_blas-config-version.
rafbiels added a commit to rafbiels/oneMath that referenced this pull request Mar 31, 2025
The generic BLAS backend currently offers limited support for
AdaptiveCpp, where:
* complex data type is not supported
* USM API is not supported

Add the required protections to make the generic BLAS backend
compile and run correctly in the capacity it offers with AdaptiveCpp.
That is, make the buffer USM without complex data work fine. Throw
the unimplemented exception for the unsupported features.

This change relies on the update of the generic blas backend to
version 0.2.0 in:
uxlfoundation/generic-sycl-components#7
rafbiels added a commit to rafbiels/oneMath that referenced this pull request Mar 31, 2025
The generic BLAS backend currently offers limited support for
AdaptiveCpp, where:
* complex data type is not supported
* USM API is not supported

Add the required protections to make the generic BLAS backend
compile and run correctly in the capacity it offers with AdaptiveCpp.
That is, make the buffer USM without complex data work fine. Throw
the unimplemented exception for the unsupported features.

This change relies on the update of the generic blas backend to
version 0.2.0 in:
uxlfoundation/generic-sycl-components#7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants